package domain;

import java.util.Objects;

public class Student extends Person{
    private boolean flag=false;       //是否填写任务
    private String stuId;       //学号唯一
    private Task task=null;          //学生任务


    public Student(String stuId) {
        this.stuId = stuId;
    }

    public Student(String name, String stuId) {
        super(name);
        this.stuId = stuId;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public String getStuId() {
        return stuId;
    }

    public void setStuId(String stuId) {
        this.stuId = stuId;
    }

    public Task getTask() {
        return task;
    }

    public void setTask(Task task) {
        this.task = task;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(stuId, student.stuId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(stuId);
    }

    @Override
    public String toString() {
        return "学号："+getStuId()+",姓名："+getName();
    }
}
